<%--
  Created by IntelliJ IDEA.
  User: pipi
  Date: 2018/4/22
  Time: 17:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>报价</title>
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/build/css/doc.css" media="all">
</head>
<body>
<div class="layui-form-item">
    <label class="layui-form-label">更新</label>
    <div class="layui-input-block site-block">
        <form class="layui-form" action="/quotation/update" method="post">
            <%--<div class="layui-form-item">--%>
                <%--<label class="layui-form-label">报价编号</label>--%>
                <%--<div class="layui-input-block">--%>
                    <%--<input type="text" name="quotationNO" required  lay-verify="required" placeholder="请输入报价编号"--%>
                           <%--autocomplete="off" class="layui-input" value="${quotation.quotationNO}">--%>
                <%--</div>--%>
            <%--</div>--%>
            <input id="quotationNO" name="quotationNO" type="hidden" value="${quotation.quotationNO}"/>
            <div class="layui-form-item">
                <label class="layui-form-label">客户</label>
                <div class="layui-input-block">
                    <select name="customerNO" lay-verify="" lay-search>
                    <c:forEach items="${customers}" var="custom">
                        <option value="${custom.customerNO}"
                                <c:if test="${custom.customerNO}==${quotation.customerNO}">selected</c:if>>
                                ${custom.customerName}</option>
                    </c:forEach>
                </select>
                    <%--<input type="text" name="customerNO" required  lay-verify="required" placeholder="请输入客户名称"--%>
                           <%--autocomplete="off" class="layui-input" value="${quotation.customerNO}">--%>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">产品</label>
                <div class="layui-input-block">
                    <select name="productNO" lay-verify="" lay-search>
                        <c:forEach items="${products}" var="product">
                            <option value="${product.productNO}"
                                    <c:if test="${product.productNO}==${quotation.productNO}">selected</c:if>>
                                    ${product.productName}</option>
                        </c:forEach>
                    </select>
                </div>
                <%--<div class="layui-input-block">--%>
                    <%--<input type="text" name="productNO" required  lay-verify="required" placeholder="请输入产品名称"--%>
                           <%--autocomplete="off" class="layui-input" value="${quotation.productNO}">--%>
                <%--</div>--%>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">报价人</label>
                <div class="layui-input-block">
                    <input type="text" name="quotationMan" required  lay-verify="required" placeholder="请输入报价人"
                           autocomplete="off" class="layui-input" value="${quotation.quotationMan}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">其他信息</label>
                <div class="layui-input-block">
                    <input type="text" name="otherInfo" required  lay-verify="required" placeholder="其他信息"
                           autocomplete="off" class="layui-input" value="${quotation.otherInfo}">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="/plugins/layui/layui.js"></script>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            // layer.msg(JSON.stringify(data.field));
            console.log(data);
            return true;

        });
    });
</script>
</body>
</html>
